package misty.mispic.app.event

import com.google.common.eventbus.EventBus as EvtBus

/**
 * Created by Misty on 2015/1/24.
 */
class EventBus {
    private static def eventBus = new EvtBus({ throwable, ctx ->
        throwable.printStackTrace()
    })

    static void register(obj) {
        println "register $obj"
        eventBus.register(obj)
    }

    static void unregister(obj) {
        println "unregister $obj"
        eventBus.unregister(obj)
    }

    static void post(event) {
        eventBus.post(event)
    }
}
